import { request } from './request.js'

// 获取所有票务类别
export const getAllTicketCategories = async () => {
  try {
    const response = await request.get('/api/categorys')
    return { success: true, data: response.data }
  } catch (error) {
    console.error('获取票务类别失败:', error)
    // 在实际环境中调用失败时返回模拟数据
    return { 
      success: true, 
      data: [
        { label: '演唱会', value: 'concert' },
        { label: '体育赛事', value: 'sports' },
        { label: '电影', value: 'movie' },
        { label: '展览', value: 'exhibition' },
        { label: '游乐园', value: 'amusement' },
        { label: '音乐会', value: 'music' },
        { label: '其他', value: 'other' }
      ]
    }
  }
}